package com.yb.sys.user.controller;


import com.yb.core.bean.Resp;
import com.yb.sys.user.repository.SysHotelDao;
import com.yb.sys.user.service.ISysHotelService;
import com.yb.sys.user.vo.PageReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 姚兵
 * @since 2022-11-23
 */
@RestController
@RequestMapping("/hotel")
public class SysHotelController {

    @Autowired
    ISysHotelService sysHotelService;

    @Autowired
    SysHotelDao sysHotelDao;
    @RequestMapping("init")
    public Resp init(){
        return sysHotelService.init();
    }

    @RequestMapping("list")
    public Resp list(){
        return Resp.ok().data(sysHotelDao.findAll());
    }

    @RequestMapping("page")
    public Resp page(@RequestBody PageReq pageRequest){
        return Resp.ok().data(sysHotelService.page(pageRequest));
    }
}
